<?php
namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{

    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
        \App\Http\Middleware\TrustProxies::class,
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,
        \App\Http\Middleware\Auth\Cookie\User::class
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\Base\Media\Compatibility::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class
        ],
        
        'api' => [
            'throttle:600,1',
            'bindings'
        ]
    ];

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        // 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        // 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'oauth.user' => \App\Http\Middleware\Oauth\User::class,
        'auth.user' => \App\Http\Middleware\Auth\User::class,
        'auth.owner.trade.supply' => \App\Http\Middleware\Auth\Owner\Trade\Supply::class,
        'auth.owner.trade.demand' => \App\Http\Middleware\Auth\Owner\Trade\Demand::class,
        'auth.refresh.trade.supply' => \App\Http\Middleware\Auth\Refresh\Trade\Supply::class,
        'auth.refresh.trade.demand' => \App\Http\Middleware\Auth\Refresh\Trade\Demand::class,
        'awstats.visit.trade.supply' => \App\Http\Middleware\Awstats\Visit\Trade\Supply::class,
        'awstats.visit.trade.demand' => \App\Http\Middleware\Awstats\Visit\Trade\Demand::class,
        'base.exists.trade.supply' => \App\Http\Middleware\Base\Exists\Trade\Supply::class,
        'base.exists.trade.demand' => \App\Http\Middleware\Base\Exists\Trade\Demand::class,
        'base.exists.trade.shop' => \App\Http\Middleware\Base\Exists\Trade\Shop::class,
        'search.keyword.trade' => \App\Http\Middleware\Search\Keyword\Trade::class
    ];
}
